/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
bool compare(struct TreeNode* root, struct TreeNode* subRoot)
{
    if(!root&&!subRoot)
    {
        return true;
    }
    else if(!root||!subRoot)
    {
        return false;
    }
    if(root->val!=subRoot->val)
    {
        return false;
    }
    return compare(root->left,subRoot->left)&&compare(root->right,subRoot->right);
}
bool isSubtree(struct TreeNode* root, struct TreeNode* subRoot)
{
    if(root)
    {
        return compare(root,subRoot)||isSubtree(root->left,subRoot)||isSubtree(root->right,subRoot);
    }
    return false;
    
}